<template>
  <div>
    <V-CommonHeaderLeft>
      <div id="app">
        <el-row>
          <!-- 头部 -->
          <div class="header">
            <el-col :span="3" class="header-nav">
              <router-link to="/">首页&nbsp;&nbsp;/</router-link>
              <router-link to="/">营销&nbsp;&nbsp;/</router-link>
              <router-link to="/">商城装修</router-link>
            </el-col>
            <el-col :span="1" :offset="20" class="header-img">
              <!-- <img src="" alt=""> -->
            </el-col>
          </div>
        </el-row>
        <div class="contents">
          <el-tabs v-model="activeName" class="tabPlane">
            <el-tab-pane label="手机端" name="first">
              <div class="phone">
                <div class="phone-header">
                  <p>页面名称</p>
                  <p>更新时间</p>
                </div>
                <el-row
                  v-for="(site,key) in tableData"
                  :key="key"
                  class="tableRow"
                  @mouseover.native="changeMask(key)"
                  @mouseout.native="changeOut()"
                >
                  <el-col :span="3">{{site.name}}</el-col>
                  <el-col :span="4" :offset="9">{{site.date}}</el-col>
                  <el-col class="hoverKuang" v-if="key == i" :style="{opacity:opacity}">
                    <router-link to="/">设为首页</router-link>
                    <router-link to="/marketingMallPhone">装修页面</router-link>
                    <router-link to="/">复制地址</router-link>
                  </el-col>
                </el-row>
              </div>
            </el-tab-pane>
            <el-tab-pane label="PC端" name="second">
              <div class="phone">
                <div class="phone-header">
                  <p>页面名称</p>
                  <p>更新时间</p>
                </div>
                <el-row
                  v-for="(site,key) in tableDataPc"
                  :key="key"
                  class="tableRow"
                  @mouseover.native="changeMaskPc(key)"
                  @mouseout.native="changeOutPc()"
                >
                  <el-col :span="3">{{site.name}}</el-col>
                  <el-col :span="4" :offset="9">{{site.date}}</el-col>
                  <el-col class="hoverKuang" v-if="key == iPc" :style="{opacity:opacityPc}">
                    <router-link to="/">设为首页</router-link>
                    <router-link to="/marketingMallPc">装修页面</router-link>
                    <router-link to="/">复制地址</router-link>
                  </el-col>
                </el-row>
              </div>
            </el-tab-pane>
          </el-tabs>
        </div>
      </div>
    </V-CommonHeaderLeft>
  </div>
</template>

<script>
import VCommonHeaderLeft from '@/components/common/vCommonHeaderLeft/VCommonHeaderLeft'
export default {
  components: {
    VCommonHeaderLeft
  },
  data () {
    return {
      activeName: 'first',
      tableData: [{
        name: '家具甲方',
        date: '2019-06-18 09:43:43'
      }],
      opacity: 0,
      i: true,
      tableDataPc: [{
        name: '家具甲方',
        date: '2019-06-18 09:43:43'
      }],
      opacityPc: 0,
      iPc: true
    }
  },
  methods: {
    changeMask (key) {
      this.opacity = 1
      this.i = key
    },
    changeOut () {
      this.opacity = 0
    },
    changeMaskPc (key) {
      this.iPc = key
      this.opacityPc = 1
    },
    changeOutPc () {
      this.opacityPc = 0
    }
  }
}
</script>

<style lang="scss" scoped>
#app {
  width: 100%;
  background-color: #f2f5f7;
  height: 100%;
  padding: 15px 10px 0px 10px;
  .header {
    height: 45px;
    .header-nav {
      line-height: 30px;
      font-size: 12px;
      display: flex;
      justify-content: space-around;
      padding-left: 10px;
      span {
        display: inline-block;
        margin-left: 10px;
      }
      a {
        color: #999999;
      }
      a:hover {
        color: #20ade5;
      }
    }
    .header-img {
      width: 25px;
      height: 25px;
      border-radius: 5px;
      border: 1px solid #dce4e7;
    }
  }
}
.header-nav > a:last-child {
  color: #333 !important;
}
.header-nav > a:last-child:hover {
  color: #333;
}
.contents {
  padding: 10px 0px 0px 0px;
  height: 500px;
  background-color: #fff;
}
.tabPlane /deep/ .el-tabs__item {
  width: 145px;
  text-align: center;
  font-size: 16px;
}
.phone {
}
.phone-header {
  display: flex;
  color: #666666;
  font-size: 12px;
  height: 50px;
  background-color: #fcfcfc;
  line-height: 50px;
  padding-left: 20px;
  border-top: 1px solid #e3e3e3;
}
.phone-header > p:nth-child(2) {
  margin: 0px 0px 0px 46%;
}
.tableRow {
  text-align: left;
  font-size: 12px;
  padding-left: 20px;
  height: 40px;
  border-bottom: 1px solid #e3e3e3;
  line-height: 40px;
}
.tableRow:hover {
  background-color:#F5F5F5;
}
.hoverKuang {
  width: 230px;
  height: 40px;
  background-color: #a3bbd4;
  font-size: 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: absolute;
  right: 0px;
}
.hoverKuang > a {
  color: #fff;
}
</style>
